From: Daniel Golle Date: Sun, 29 Nov 2020 23:21:04 +0000 (+0000) Subject: jail: always call cgroups_free() X-Git-Url: http://git.openwrt.org/%22https:/collectd.org//%22http:/www.crowdsec.net/%22/%22https:/collectd.org/%22http:/www.crowdsec.net/%22?a=commitdiff_plain;h=f67a66f196080c483a773c153d008d989bc62a5b;p=project%2Fprocd.git jail: always call cgroups_free() In commit 3019f50 ("jail: leak less memory") memory handling in cgroups related code was refactored. That allows to call cgroups_free() unconditionally and remove the child-branch of in free_opts(). Signed-off-by: Daniel Golle --- diff --git a/jail/jail.c b/jail/jail.c index 82ba4a5..529ac6b 100644 --- a/jail/jail.c +++ b/jail/jail.c @@ -249,6 +249,7 @@ static void free_opts(bool parent) { free_library_search(); mount_free(); + cgroups_free(); /* we need to keep argv, envp and seccomp filter in child */ if (parent) { /* parent-only */ @@ -259,9 +260,6 @@ static void free_opts(bool parent) { free_oci_envp(opts.jail_argv); free_oci_envp(opts.envp); - } else { /* child-only */ - if (opts.ocibundle) - cgroups_free(); } free_rlimits();